package com.common.jiji.methods;

import com.common.jiji.JJDriverService;
import com.common.jiji.entity.BaseJJBean;
import com.common.jiji.entity.JJOrderListBean;
import com.common.jiji.entity.LoginBean;
import com.common.jiji.parms.LoginParms;
import com.common.jiji.parms.OrderParms;
import com.common.retrofit.base.BaseMethods;

import rx.Observable;
import rx.Subscriber;

public class JJOrderListMethods extends BaseMethods {

    private static JJOrderListMethods m_ins = null;

    public static JJOrderListMethods getInstance() {
        if (m_ins == null) {
            synchronized (JJOrderListMethods.class) {
                if (m_ins == null) {
                    m_ins = new JJOrderListMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "driver/";
    }

    private JJDriverService initService() {
        return getRetrofit().create(JJDriverService.class);
    }


    public void     getOrderListNow(Subscriber<JJOrderListBean> subscriber
            , OrderParms loginParms
    ) {

        Observable observable = initService().getOrderListNow(loginParms);
        toOtherSubscribe(observable, subscriber);
    }
}
